<template>
  <div class="index">
  	<div class="sreePublic">
  		<div id="" style="text-align: center;">
  			<em class="iconfont" @click="vfun_back">&#xe61f;</em>
  		</div>
		修改密码
  	</div>
  	<div>
  		<div class="delivery">
  			<ul>
  				<li>
  					<span>旧密码：</span>
  					<input v-model="operatorPayPassword" type="password" placeholder="输入旧密码"/>
  				</li>
  				<li>
  					<span>新密码：</span>
  					<input type="password" ref="password" v-model="operatorPayPassword2" @keyup="vfun_passnum" placeholder="输入新密码"/>
  					<a class="yanpass" @click="vfun_yan">
							<em class="iconfont" v-if="vue_yan">&#xe6e3;</em>
							<em class="iconfont" v-else>&#xe8ed;</em>
						</a>
  				</li>
  				<!--<li>
  					<span>确认密码：</span>
  					<input type="password" v-model="operatorPayPassword3"/>
  				</li>-->
  			</ul>
  		</div>

	    <div class="footer">
	    	<a @click="addDelivery" :class="{activeBtn:vue_passbtn}">保存</a>
	    </div>
	    
	</div>
  </div>
</template>

<script>
	import * as address from '../../assets/data/address';
	import { MessageBox } from 'mint-ui';
	import { Toast } from 'mint-ui';  //引入弹框
export default {
  name: 'addDelivery',
  data () {
    return {
    	vue_passbtn:true,
    		vue_yan:true,
    	  operatorPayPassword:'',
    	  operatorPayPassword2:'',
    	  operatorPayPassword3:'',
    }
  },
  methods:{
  	vfun_passnum(){
  		if (this.operatorPayPassword!='' && this.operatorPayPassword2.length>=6) {
  			this.vue_passbtn=false;
  		}else{
  			this.vue_passbtn=true;
  		}
  		
  	},
			vfun_yan(){
		  		this.vue_yan=!this.vue_yan;
		  		if (this.vue_yan) {
							this.$refs['password'].type = "password";
						} else{
							this.$refs['password'].type = "text";
						}
		  	},
	addDelivery(){
		if (this.operatorPayPassword3!=this.operatorPayPassword2) {
			Toast({
				  message: '密码不一直',
				  iconClass: 'fontSize iconfont icon-shibai'
				});
			return false;
		}
//		this.axios({
//			method: 'PUT',
//			url: "/v3/member/operators/"+this.rendCode+"/"+this.md5(this.operatorPayPassword).toUpperCase()+"/settlePayPassword",
//			data:{
//			}
//			}).then((res) => {
//				Toast({
//				  message: '设置成功',
//				  iconClass: 'fontSize iconfont icon-chenggong'
//				});
//			}).catch((err)=>{
//				Toast({
//				  message: err.response.data,
//				  iconClass: 'fontSize iconfont icon-shibai'
//				});
//	  	});
		

		
	},
  	vfun_back(){
  		history.back();
  	},
  },
  watch: {
      
  },
    created(){
    },
  mounted(){
  	
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
*{
	transition: 0.2s;
}
h1, h2 {
  font-weight: normal;
}

ul {
  list-style-type: none;
  padding: 0;
}
.index{
	box-sizing: border-box;
	margin-bottom: 1.5rem;
}

.delivery{
	margin-top: 1.2rem;
}
.delivery li{
	border-bottom: 1px solid #e7e7e7;
	box-sizing: border-box;background: #fff;
	height: 1.5rem;
	width: 90%;
	margin: 0 auto;
	line-height: 1.5rem;
	position: relative;
}

.delivery input{
	border: 0;
	height: 1rem;
}

.footer{
	background: #fff;
	width: 100%;
}
.footer a{
	display: block;
	width: 90%;
	margin: 0 auto;
	margin-top: 0.5rem;
	color: #fff;
	text-align: center;
	height: 1rem;
	background: #D50B0A;
	line-height: 1rem;
	border-radius:4px ;
}
.delivery .iconfont{
	float: right;
	color: #ccc;
	font-size: 14px;
}
.deliverytab{
	width: 10rem;
	height: 9rem;
}
.delivery-th{
	margin-top: 0.4rem;color: #D50B0A;
}
.delivery-th span:first-child{
	float: left;
	margin-left: 5%;
}
.delivery-th span:last-child{
	float: right;
	margin-right: 5%;
}
.active{
	pointer-events: none;
}
.yanpass{
		position: relative;
		top: 0.2rem;
	}
	.yanpass em{
		color: #b8b8b8;
		font-size: 18px!important;
	}
	.activeBtn{
		background: #EEEEEE!important;
		color: #d4d4d4!important;
		pointer-events: none;
	}
</style>
